{{!
  Copyright (c) HashiCorp, Inc.
  SPDX-License-Identifier: BUSL-1.1
}}

{{#each @configModels as |configModel|}}
  {{#each configModel.displayAttrs as |attr|}}
    {{! public key while not sensitive when editing/creating, should be hidden by default on viewing }}
    {{#if (or attr.options.sensitive (eq attr.name "publicKey"))}}
      <InfoTableRow
        alwaysRender={{not (is-empty-value (get configModel attr.name))}}
        @label={{or attr.options.label (to-label attr.name)}}
        @value={{get configModel (or attr.options.fieldValue attr.name)}}
      >
        <MaskedInput @value={{get configModel attr.name}} @name={{attr.name}} @displayOnly={{true}} @allowCopy={{true}} />
      </InfoTableRow>
    {{else}}
      <InfoTableRow
        @alwaysRender={{not (is-empty-value (get @model attr.name))}}
        @label={{or attr.options.label (to-label attr.name)}}
        @value={{get configModel (or attr.options.fieldValue attr.name)}}
        @formatTtl={{eq attr.options.editType "ttl"}}
      />
    {{/if}}
  {{/each}}
{{else}}
  {{! Prompt user to configure the secret engine }}
  <EmptyState
    data-test-config-cta
    @title="{{@typeDisplay}} not configured"
    @message="Get started by configuring your {{@typeDisplay}} secrets engine."
  >
    <Hds::Link::Standalone
      @icon="chevron-right"
      @iconPosition="trailing"
      @text="Configure {{@typeDisplay}}"
      @route="vault.cluster.secrets.backend.configuration.edit"
      @model={{@id}}
    />
  </EmptyState>
{{/each}}